//
//  DataHandle.h
//  A1.0
//
//  Created by lanou3g on 15-4-7.
//  Copyright (c) 2015年 ccandxx. All rights reserved.
//

#import <Foundation/Foundation.h>

@class jokeModel;
@class picModel;
@class womenModel;
@class videoModel;
@class petModel;

@interface DataHandle : NSObject

//单例类方法
+(instancetype)shareDataBase;

//打开数据库
-(void)openDB;


//获取Documents路径
-(NSString *)documentsPath;



//关闭数据库
-(void)closeDB;


//建表
-(void)createJokeTable;//笑话
-(void)createPicTable;//趣图
-(void)createWomenTable;//美女
-(void)createVideoTable;//视频
-(void)createPetTable;//宠物




//插入数据(增)
-(void)insertJoke:(jokeModel *)aJoke;//笑话
-(void)insertPic:(picModel *)aFun;//趣图
-(void)insertWomen:(womenModel *)aWomen;//美女
-(void)insertVideo:(videoModel *)aVideo;//视频
-(void)insertPet:(petModel *)aPet;//宠物


//删除数据(删)
-(void)deleteWithJokeID:(NSInteger)jid;
-(void)deleteWithPicID:(NSInteger)fid;
-(void)deleteWithWomenID:(NSInteger)wid;
-(void)deleteWithVideoID:(NSInteger)vid;
-(void)deleteWithPetID:(NSInteger)pid;


//查找数据(查)

//1.全查
-(NSMutableArray *)selectAllJoke;
-(NSMutableArray *)selectAllFun;
-(NSMutableArray *)selectAllWomen;
-(NSMutableArray *)selectAllVideo;
-(NSMutableArray *)selectAllPet;




@end
